package com.simon.hse.activity.safe.workpermit;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;
import com.simon.hse.activity.SignActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 关闭作业许可证
 */
@ContentView(R.layout.activity_close_work_permit)
public class CloseWorkPermitActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;

    @ViewInject(R.id.ll_territorial_supervisor)
    LinearLayout llTerritorialSupervisor;

    String from;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mTv_common_title.setText("关闭作业许可证");
        from = getIntent().getStringExtra("from");
        switch (from) {
            //有效
            case "effective":
//                llTerritorialSupervisor.setVisibility(View.VISIBLE);
                break;
            //关闭待确认
            case "closeConfirm":
                llTerritorialSupervisor.setVisibility(View.GONE);
                break;
            default:
                break;
        }
//        Bundle bundle = getIntent().getExtras();
//        if (bundle == null) {
//            mLl_danger_stop_bottom.setVisibility(View.VISIBLE);
//            mTv_apply_work_permit_xgbg.setText("特殊作业许可证及相关附件信息");
//        } else {
//            mLl_danger_stop_bottom.setVisibility(View.INVISIBLE);
//            mTv_apply_work_permit_xgbg.setText("特殊作业许可证及相关表格");
//        }
    }

    @Event(value = {R.id.iv_common_left, R.id.tv_train_record_cancel, R.id.tv_train_record_confirm})
    private void finish(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
                break;
            case R.id.tv_train_record_cancel:
                finish();
                break;
            case R.id.tv_train_record_confirm:
                Intent intentRight = new Intent(CloseWorkPermitActivity.this, SignActivity.class);
                startActivity(intentRight);
                finish();
                break;
        }
    }
}
